package com.example.cloudapirabbitmq.simple;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

// 消费者
@Component
public class SimpleConsumer {

    @RabbitListener(queues = "simple.queue")
    public void receive(String msg) {
        System.out.println("===============================");
        System.out.println("消费者: " + LocalDateTime.now());
        System.out.println("Received: " + msg);
    }
}